package com.hl.learndagger.di.module;

import com.hl.learndagger.VIPUser;
import com.hl.learndagger.di.qualifier.MyQualifier;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by Administrator on 2017/4/18.
 */

@Module
public class DemoQualifierModule {

    private String vipNumber;


    public DemoQualifierModule(String vipNumber)
    {
        this.vipNumber = vipNumber;
    }

    @Provides
    String providesVipNumber()
    {
        return vipNumber;
    }

    /**
     * default parameter
     * */
    @Provides
    @MyQualifier("dp")
    VIPUser providesVipUserDP()
    {
        return new VIPUser();
    }

    /**
     * custom parameter
     * */
    @Provides
    @MyQualifier("cp")
    VIPUser providesVipUserCP(String vipNumber)
    {
        return new VIPUser(vipNumber);
    }
}
